package com.mmlc.businessutils;

import android.graphics.BitmapFactory;

import com.mmlc.meimei.lichengkongjian.App;
import com.mmlc.meimei.lichengkongjian.R;
import com.mmlc.meimei.lichengkongjian.been.AllOrderBean;
import com.mmlc.meimei.lichengkongjian.been.OrderDetailBean;
import com.mmlc.meimei.lichengkongjian.been.RefundDetailBean;
import com.mmlc.meimei.lichengkongjian.been.SendTraceBean;
import com.mmlc.meimei.lichengkongjian.been.WaitPayBean;
import com.mmlc.meimei.lichengkongjian.been.WaitReceivedBean;
import com.mmlc.meimei.lichengkongjian.been.WaitSendBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/7/23 0023
 * .
 */
public class ShopOrderUtils {

    /**
     * 获取待发送订单
     */

    public static List<WaitSendBean> getWaitSend() {
        ArrayList<WaitSendBean> list;
        list = new ArrayList<WaitSendBean>();
        for (int i = 20; i < 30; i++) {
            WaitSendBean bean = new WaitSendBean();
            bean.photo = BitmapFactory.decodeResource(App.context.getResources(), R.mipmap.ic_launcher);
            bean.orderNumber = "123423542545245";
            bean.shopInfo = "商品不措商品不措商品不措商品不措商品不措商品不措商品不措商品不措";
            bean.shopColor = "深色";
            bean.shopPrice = "40";
            bean.shopCount = "2";
            bean.date = "2016.3.2";
            bean.convertData();
            list.add(bean);
        }
        return list;
    }

    /**
     * 获取待接收订单
     */
    public static List<WaitReceivedBean> getWaitReceived() {
        ArrayList<WaitReceivedBean> list;
        list = new ArrayList<WaitReceivedBean>();
        for (int i = 0; i < 30; i++) {
            WaitReceivedBean bean = new WaitReceivedBean();
            bean.photo = BitmapFactory.decodeResource(App.context.getResources(), R.mipmap.ic_launcher);
            bean.orderNumber = "123423542545245";
            bean.shopInfo = "商品不措商品不措商品不措商品不措商品不措商品不措商品不措商品不措";
            bean.shopColor = "深色";
            bean.shopPrice = "40";
            bean.date = "2016.3.2";
            bean.confirmReceived = 1 + "";
            bean.convertData();
            list.add(bean);
        }
        return list;
    }

    /**
     * 获取待支付订单
     */
    public static List<WaitPayBean> getWaitPay() {
        ArrayList<WaitPayBean> list = null;
      /*  list = new ArrayList<WaitPayBean>();
        for (int i = 20; i < 30; i++) {
            WaitPayBean bean = new WaitPayBean();
            bean.isChecked = true;
            bean.photo = "https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1471500215&di=1c0bdbd52c3e0ee7058997db99d3644b&src=http://e.hiphotos.baidu.com/image/pic/item/f703738da97739120f92f746fd198618367ae265.jpg";
            bean.shopInfo = "商品不措商品不措商品不措商品不措商品不措商品不措商品不措商品不措";
            bean.shopColor = "深色";
            bean.shopPrice = "40";
            bean.shopCount = 2;
            list.add(bean);
        }*/
        return list;
    }

    /**
     * 获取所有订单
     */
    public static List<AllOrderBean> getAllOrderBean() {
        return CreateVirtualData.getAllOrderData();
    }

    /**
     * 获取订单的详细数据
     */
    public static OrderDetailBean getDetailOrderBean() {
        OrderDetailBean bean = new OrderDetailBean();
        bean.name = "张三";
        bean.address = "四川省南充市嘉陵区家语录李羽花园二分区家另一种小区旁边";
        bean.phone = "13551821348";
        bean.allShopPrice = "30";
        bean.sendMoney = "10";
        bean.discount = "10";
        bean.orderPrice = "10";
        bean.realPay = "10";
        bean.orderNumber = "123456789";
        bean.sendNumber = "123456789";
        bean.createTime = "2016-2-16 18:51:02";
        bean.payTime = "2016-2-16 18:51:02";
        bean.sendTime = "2016-2-16 18:51:02";
        bean.commitTime = "2016-2-16 18:51:02";

        List<OrderDetailBean.DetailItemBean> listItemBean = new ArrayList<OrderDetailBean.DetailItemBean>();
        for (int j = 0; j < 3; j++) {
            OrderDetailBean.DetailItemBean itemBean = new OrderDetailBean.DetailItemBean();
            itemBean.photo = "http://p0.so.qhmsg.com/bdr/_240_/t01c477512348871e0f.jpg";
            itemBean.desc = "商品非常不措商品非常不措商品非常不措商品非常不措商品非常不措商品非常不措";
            itemBean.color = "颜色: 黄色";
            itemBean.length = "尺码：33";
            itemBean.back = "七天退款";
            itemBean.currentPrice = "¥ 30";
            itemBean.beforPrice = "¥ 30";
            itemBean.count = "x2";

            List<Integer> integers = new ArrayList<>();
            integers.add(7);
            integers.add(8);
            itemBean.buttonType = integers;
            listItemBean.add(itemBean);
        }

        bean.detailTtemBean = listItemBean;
        return bean;
    }

    public static SendTraceBean getSendTraceBean() {
        SendTraceBean bean = new SendTraceBean();
      /*  bean.sendState = "包裹发往调拨中心";
        bean.sendNumber = "12345647897978";
        bean.infoSource = "信息来源: 顺丰速运";
        ArrayList<SendTraceBean.TraceBean> listBean = new ArrayList<>();

        for (int i = 0; i < 20; i++) {
            SendTraceBean.TraceBean itemBean = new SendTraceBean.TraceBean();
            itemBean.desc = "四川省南充市嘉陵区";
            itemBean.time = "2012-7-9 18:20:25";
            listBean.add(itemBean);
        }
        bean.listTraceBean = listBean;*/
        return bean;
    }

    /**获取退款明细*/
    public String money;//退款金额
    public String returnMoney;//退还至原支付号金额
    public String refundReason;//退还原因
    public String applyTime;
    public String refundState;//退款状态
    public String refundStateDesc;//退款状态描述
    public static RefundDetailBean getRefundDetailBean(){
        RefundDetailBean bean = new RefundDetailBean();
        bean.money = "2000";
        bean.returnMoney = "2000";
        bean.refundReason = "商品不好";
        bean.applyTime = "2016-3-25 18:25:26";
        bean.refundState = "退款完成";
        bean.refundStateDesc = "力诚空间退款完成，稍后会将余额返回至你的账号";
        return bean;
    }
}
